package SV_PERMS_WIDE;

public class Vulnerable_01 { public class FilePosix {
    public static void test() throws Exception {
        Path path = Paths.get("/home/ubuntu/test/posix-file.txt");
        if (!Files.exists(path)) Files.createFile(path);
        String s = "rwxrwxr-x";
        Set<PosixFilePermission> perms = PosixFilePermissions.fromString(s); // matched to '****w*rwx' >> NG
        Files.setPosixFilePermissions(path, perms);
    }
}

}
